<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
 
<h3>내 거래내역 보기</h3>
<hr>
판매내역<br><br>
<center>
<table border="1">
  <tr>
    <th>제목</th>
    <th>상품명</th>
    <th>가격</th>
    <th>구매자</th>
    <th>거래시각</th>
  </tr>
  
  <c:forEach items="${requestScope.thResult.sellList.list }" var="list">
   <tr>
    <td width="200" align="center"><a href="${initParam.root}sell.do?command=showContent&sellNo=${list.svo.sellNo}">${list.svo.title }</a></td>
    <td width="80" align="center">${list.svo.productName }</td>
    <td width="100" align="center">${list.svo.productPrice }원</td>
    <td width="80" align="center">${list.buyer }</td>
    <td width="120" align="center">${list.timeTraded }</td>
  </tr>
  
  </c:forEach>

</table>
<br>

<c:set var="flag" value="${requestScope.thResult.sellList.pagingBean.previousPageGroup }"></c:set>
<c:set var="next" value="${requestScope.thResult.sellList.pagingBean.nextPageGroup }"></c:set>
 
 <c:if test="${flag==true }">
 	<a href="${initParam.root }member.do?command=viewMyTH&pageSell=${requestScope.thResult.sellList.pagingBean.startPageOfPageGroup-1 }">이전</a>
 </c:if>
 
 
<c:forEach var="i" begin="${requestScope.thResult.sellList.pagingBean.startPageOfPageGroup }" end="${requestScope.thResult.sellList.pagingBean.endPageOfPageGroup }">
		<c:choose>
			<c:when test="${i == requestScope.thResult.sellList.pagingBean.nowPage }">
				${i }
			</c:when>
			<c:otherwise>
				<a href="${initParam.root }member.do?command=viewMyTH&pageSell=${i }">${i}</a>
			</c:otherwise>
		</c:choose>
</c:forEach>

<c:if test="${next==true}">
			<a href="${initParam.root }member.do?command=viewMyTH&pageSell=${requestScope.thResult.sellList.pagingBean.endPageOfPageGroup+1}">다음</a>
		</c:if>
</center>

<hr>
구매내역<br><br>
<center>
<table border="1">
  <tr>
    <th>제목</th>
    <th>상품명</th>
    <th>가격</th>
    <th>판매자</th>
    <th>거래시각</th>
  </tr>
  
  <c:forEach items="${requestScope.thResult.buyList.list }" var="list2">
   <tr>
    <td width="200" align="center"><a href="${initParam.root}sell.do?command=showContent&sellNo=${list2.svo.sellNo}">${list2.svo.title }</a></td>
    <td width="80" align="center">${list2.svo.productName }</td>
    <td width="100" align="center">${list2.svo.productPrice }원</td>
    <td width="80" align="center">${list2.seller }</td>
    <td width="120" align="center">${list2.timeTraded }</td>
  </tr>
  
  </c:forEach>

</table>

<br>

<c:set var="flag2" value="${requestScope.thResult.buyList.pagingBean.previousPageGroup }"></c:set>
<c:set var="next2" value="${requestScope.thResult.buyList.pagingBean.nextPageGroup }"></c:set>
 
 <c:if test="${flag2==true }">
 	<a href="${initParam.root }member.do?command=viewMyTH&pageBuy=${requestScope.thResult.buyList.pagingBean.startPageOfPageGroup-1 }">이전</a>
 </c:if>
 
 
<c:forEach var="i" begin="${requestScope.thResult.buyList.pagingBean.startPageOfPageGroup }" end="${requestScope.thResult.buyList.pagingBean.endPageOfPageGroup }">
		<c:choose>
			<c:when test="${i == requestScope.thResult.buyList.pagingBean.nowPage }">
				${i }
			</c:when>
			<c:otherwise>
				<a href="${initParam.root }member.do?command=viewMyTH&pageBuy=${i }">${i}</a>
			</c:otherwise>
		</c:choose>
</c:forEach>
<c:if test="${next2==true}">
			<a href="${initParam.root }member.do?command=viewMyTH&pageBuy=${requestScope.thResult.buyList.pagingBean.endPageOfPageGroup+1}">다음</a>
		</c:if>
</center>
